<template>

	<view class="page">
		<view class="notice">
			<navigator url="/pages/visitorsNotice/visitorsNotice">
				<text class="noticeText">位于四川省成都市郫都区德源镇东林艺术村，是全国唯一经袁隆平院士授权以其名字命名的园区。
					全国首批科学家精神教育基地，园区以袁隆平院士为精神支柱，以稻蒜文化为基础，将科研场景
					变成教学场景，建立劳动教育、农业科普教育基地及成人实训基地。</text>
			</navigator>
		</view>

		<view class="bookingContent">
			<view class="booking" @click="goBook1">
				<navigator url="/pages/infoSubject/infoSubject">
					<image class="navPng" src="../../static/navi/1.png" mode=""></image>
					<text class="navText">个人预约</text>
					<BR></BR>
					<text class="navSubText">Personal reservation</text>
				</navigator>
			</view>

			<view class="booking" @click="goBook2">
				<navigator url="/pages/group/group">
					<image class="navPng" src="../../static/navi/2.png" mode=""></image>
					<text class="navText"> 团队预约</text>
					<BR></BR>
					<text class="navSubText">Group reservation</text>
				</navigator>
			</view>

			<view class="booking" @click="navigateToInfoPage">
				<!-- <navigator url="/pages/ScanQR/ScanQR"> -->
		<!-- 		{{userInfo.userInfoType }}
				{{userInfo.userInfoType ==="person"}} -->
				<image class="navPng" src="../../static/navi/3.png" mode=""></image>
				<text class="navText"> 扫码入园</text>
				<BR></BR>
				<text class="navSubText">Scan the QR code to enter the park</text>
				<!-- </navigator> -->
			</view>
		</view>
	</view>
</template>



<script>
	export default {
		data() {
			return {
				userInfo: {}
			};
		},
		onLoad() {
			console.log('onLoad')
			// uni.getStorageSync({
			// 	key: 'userData',
			// 	success: (res) => {
			// 		this.userInfo = JSON.parse(res.data);
			// 		console.log(this.userInfo.userInfoType )
			// 		console.log(this.userInfo.userInfoType ==='person')
			// 	}
			// });
		},
		onShow(){
			console.log('show')
			// uni.getStorageSync()
			uni.getStorage({
				key: 'userData',
				success: (res) => {
					this.userInfo = JSON.parse(res.data);
					console.log(this.userInfo.userInfoType )
					console.log(this.userInfo.userInfoType ==='person')
				}
			});
			// console.log(this.userInfo.userInfoType)
		},
		computed: {
		  userInfoType() {
		    return this.userInfo.userInfoType;
		  }
		},

		methods: {
			navigateToInfoPage() {
				console.log(this.userInfo.userInfoType)
				if (this.userInfo.userInfoType === "person") {
					uni.navigateTo({
						url: "/pages/ScanQRPersonal/ScanQRPersonal"
					})
				} else {
					uni.navigateTo({
						url: "/pages/ScanQR/ScanQR"

					});
				}
			}
		}
	};
</script>


<style>
	.page {
		width: 678rpx;
		height: 1000rpx;
		background-image: url('https://pic.imgdb.cn/item/668c9a49d9c307b7e9193f14.png');
		border-radius: 12px;
		padding-top: 200rpx;
		margin-left: 5%;
	}

	.notice {
		width: 510rpx;
		height: 375rpx;
		font-family: PingFangSC-Regular;
		font-size: 12rpx;
		color: #05261B;
		letter-spacing: 0;
		line-height: 21px;
		background: #FFFFFF;
		background-color: transparent;
		border-radius: 12px;
		margin-bottom: 80rpx;
		margin-left: 90rpx;
		margin-top: 30rpx;
	}

	.noticeText {
		width: 259px;
		height: 126px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 10px;
		color: #05261B;
		letter-spacing: 0;
		line-height: 21px;
	}

	.booking {
		width: 580rpx;
		height: 140rpx;
		background: #FFFFFF;
		border-radius: 12px;
		margin-top: 28rpx;
		margin-bottom: 24rpx;
		margin-left: 60rpx;
		margin-right: 60rpx;
	}


	.navText {
		width: 61.48px;
		height: 21px;
		font-family: PingFangSC-Medium;
		font-weight: 500;
		font-size: 15px;
		font-weight: bold;
		color: #05261B;
		letter-spacing: 0;
		vertical-align: middle;
		margin-top: 35rpx;
		float: left;
	}

	.navSubText {
		width: 116.82px;
		height: 17px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 12px;
		color: #5F5F5F;
		letter-spacing: 0;
		margin-top: 75rpx;
		margin-left: -118rpx;
		float: left;
	}

	.navPng {
		width: 64rpx;
		height: 64rpx;
		margin-left: 30rpx;
		margin-top: 40rpx;
		vertical-align: middle;
		margin-right: 30rpx;
		float: left;
	}
</style>